{% extends 'dash/index.html' %}
{% block 'content_show' %}
<!-- block 模块 -->
<!-- title -->
<div class="container-fluid am-cf">
    <div class="row">
        <div class="am-u-sm-12 am-u-md-12 am-u-lg-9">
            <div class="page-header-heading">
            	<span class="am-icon-home page-header-heading-icon"></span> 
            	商品信息列表 
            	<small>Goods list</small>
            </div>
        </div>
    </div>
</div>
<!-- END title -->

<!-- 商品信息列表 -->
<div class="row">
    <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
        <div class="widget am-cf">
            <div class="widget-head am-cf">
                <div class="widget-body  am-fr">
                    <!-- 控制选项 -->
                    <div class="am-u-sm-12 am-u-md-6 am-u-lg-6">
                        <div class="am-form-group">
                             <div class="am-btn-toolbar">
                                 <div class="am-btn-group am-btn-group-xs">
                                     <button type="button" class="am-btn am-btn-default am-btn-success"><span class="am-icon-plus"></span> 新增</button>
                                     <button type="button" class="am-btn am-btn-default am-btn-secondary"><span class="am-icon-save"</button>
                                     <button type="button" class="am-btn am-btn-default am-btn-warning"><span class="am-icon-archive"></span> 审核</button>
                                     <button type="button" class="am-btn am-btn-default am-btn-danger"><span class="am-icon-trash-o"></span> 删除</button>
                                 </div>
                             </div>
                        </div>
                    </div>
                    <!-- 控制选项END -->

                    <form>
                        <!-- 条件筛选 -->
                        <div class="am-u-sm-12 am-u-md-6 am-u-lg-3">
                            <div class="am-form-group tpl-table-list-select">
                                <select name="search_type" data-am-selected="{btnSize: 'sm'}" style="display: none;">
                                  <option value="title">商品名</option>
                                  <option value="company">发行公司</option>
                                </select>
                            </div>
                        </div>
                        <!-- 条件筛选END -->

                        <!-- 输入框 -->
                        <div class="am-u-sm-12 am-u-md-12 am-u-lg-3">
                            <div class="am-input-group am-input-group-sm tpl-form-border-form cl-p">
                                <input name="keywords" type="text" class="am-form-field ">
                                <span class="am-input-group-btn">
                                    <button class="am-btn  am-btn-default am-btn-success tpl-table-list-field am-icon-search"></button>
                                </span>
                            </div>
                        </div>
                        <!-- END输入框 -->
                    </form>

                    <div class="am-u-sm-12">
                <table width="100%" class="am-table am-table-compact am-table-striped tpl-table-black ">
                    <thead>
                        <!-- 商品信息数据头 -->
                        <tr>
                            <th>缩略图</th>
                            <th>名称</th>
                            <th>分类</th>
                            <th>发行公司</th>
                            <th>单价</th>
                            <th>库存量</th>
                            <th>购买量</th>
                            <th>点击量</th>
                            <th>状态</th>
                            <th>添加时间</th>

                        </tr>
                        <!-- 商品信息数据头END -->
                    </thead>
                    <tbody>
                        <!-- 用户信息数据 -->
                        {% for v in goods_info %}
                        <tr class="gradeX">
                            <!-- 缩略图 -->
                            <td>
                                <img src="/static/goods/{{ v.photo_url }}" class="tpl-table-line-img" alt="" height="100">
                            </td>
                            <!-- 缩略图END -->

                            <!-- 名称 -->
                            <td class="am-text-middle">{{ v.title }}</td>
                            <!-- 名称END -->

                            <!-- 分类 -->
                            <td class="am-text-middle">{{ v.type_name }}</td>
                            <!-- 分类END -->

                            <!-- 发行公司 -->
                            <td class="am-text-middle">{{ v.company }}</td>
                            <!-- 发行公司END -->

                            <!-- 单价 -->
                            <td class="am-text-middle">{{ v.price }}</td>
                            <!-- 单价END -->

                            <!-- 库存量 -->
                            <td class="am-text-middle">{{ v.store }}</td>
                            <!-- 库存量END -->

                            <!-- 购买量 -->
                            <td class="am-text-middle">{{ v.num }}</td>
                            <!-- 购买量END -->

                            <!-- 点击量 -->
                            <td class="am-text-middle">{{ v.clicknum }}</td>
                            <!-- 点击量END -->

                            <!-- 状态 -->
                            {% if v.state == 1 %}
                                <td class="am-text-middle">新添加</td>
                            {% elif v.state == 2 %}
                                <td class="am-text-middle">在售</td>
                            {% elif v.state == 3 %}
                                <td class="am-text-middle">下架</td>
                            {% endif %}
                            <!-- 状态END -->

                            <!-- 添加时间 -->
                            <td class="am-text-middle">{{ v.addtime }}</td>
                            <!-- 添加时间END -->

                            <!-- 操作 -->
                            <td class="am-text-middle">
                                <div class="tpl-table-black-operation">
                                    <a href="{% url 'dash_goods_edit_page' %}?goods_id={{ v.id }}">
                                        <i class="am-icon-pencil"></i> 编辑
                                    </a>
                                    <a href="{% url 'dash_del_goods' %}?goods_id={{ v.id }}" class="tpl-table-black-operation-del">
                                        <i class="am-icon-trash"></i> 删除
                                    </a>
                                </div>
                            </td>
                            <!-- 操作END -->
                        </tr>
                        {% endfor %}
                        <!-- 用户信息数据END -->
                    </tbody>
                </table>
                    </div>
                    <div class="am-u-lg-12 am-cf">

                        <!-- 分页 -->
                        <div class="am-fr">
                            <ul class="am-pagination tpl-pagination">
                                {% load pagetag %}
                                <!-- 分页前滚 -->
                                {% if goods_info.has_previous %}
                                    <li>
                                        <a href="/dashboard/goods/goods_list_page/{{ goods_info.previous_page_number }}">
                                        «
                                        </a>
                                    </li>
                                {% endif %}
                                <!-- END分页前滚 -->

                                <!-- 分页中段显示 -->
                                {% for v in goods_info.paginator.page_range %}
                                    <!-- 
                                        user_info.number 为当前页码
                                        v 为当前循环出来的页码数  1 2 3 4 5 6 7 8 9 10
                                     -->
                                    {% circle_page  goods_info.number v '/dashboard/goods/goods_list_page/' keep_search %}

                                {% endfor %}
                                <!-- END分页中段显示 -->

                                <!-- 分页后滚 -->
                                {% if goods_info.has_next %}
                                    <li>
                                        <a href="/dashboard/goods/goods_list_page/{{ goods_info.next_page_number }}">
                                        »
                                        </a>
                                    </li>
                                {% endif %}
                                <!-- END分页后滚 -->
                            </ul>
                        </div>
                        <!-- 分页END -->

                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- END 商品信息列表 -->

<!-- END block 模块 -->
{% endblock %}